package xby.study.xmlweb.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


public class LoginServlet extends HttpServlet {
    private String message;

    public void init() {
        message = "LoginServlet!";
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {


        String user = request.getParameter("user");
        String pwd = request.getParameter("pwd");


        response.setContentType("text/html");

        // Hello
        PrintWriter out = response.getWriter();
        out.println("<html><body>");
        out.println("<h1>" + message + "【"+user+"-" +pwd +"】"+"</h1>");
        out.println("</body></html>");
    }

    public void destroy() {
    }
}